{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport clsx from 'clsx';\nimport extractEventHandlers from './extractEventHandlers';\nimport omitEventHandlers from './omitEventHandlers';\n\n/**\n * Merges the slot component internal props (usually coming from a hook)\n * with the externally provided ones.\n *\n * The merge order is (the latter overrides the former):\n * 1. The internal props (specified as a getter function to work with get*Props hook result)\n * 2. Additional props (specified internally on an unstyled component)\n * 3. External props specified on the owner component. These should only be used on a root slot.\n * 4. External props specified in the `componentsProps.*` prop.\n * 5. The `className` prop - combined from all the above.\n * @param parameters\n * @returns\n */\nexport default function mergeSlotProps(parameters) {\n  var getSlotProps = parameters.getSlotProps,\n    additionalProps = parameters.additionalProps,\n    externalSlotProps = parameters.externalSlotProps,\n    externalForwardedProps = parameters.externalForwardedProps,\n    className = parameters.className;\n  if (!getSlotProps) {\n    // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,\n    // so we can simply merge all the props without having to worry about extracting event handlers.\n    var _joinedClasses = clsx(externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className, className, additionalProps == null ? void 0 : additionalProps.className);\n    var _mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n    var _props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);\n    if (_joinedClasses.length > 0) {\n      _props.className = _joinedClasses;\n    }\n    if (Object.keys(_mergedStyle).length > 0) {\n      _props.style = _mergedStyle;\n    }\n    return {\n      props: _props,\n      internalRef: undefined\n    };\n  } // In this case, getSlotProps is responsible for calling the external event handlers.\n  // We don't need to include them in the merged props because of this.\n\n  var eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps));\n  var componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);\n  var otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);\n  var internalSlotProps = getSlotProps(eventHandlers); // The order of classes is important here.\n  // Emotion (that we use in libraries consuming MUI Base) depends on this order\n  // to properly override style. It requires the most important classes to be last\n  // (see https://github.com/mui/material-ui/pull/33205) for the related discussion.\n\n  var joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);\n  var mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n  var props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);\n  if (joinedClasses.length > 0) {\n    props.className = joinedClasses;\n  }\n  if (Object.keys(mergedStyle).length > 0) {\n    props.style = mergedStyle;\n  }\n  return {\n    props: props,\n    internalRef: internalSlotProps.ref\n  };\n}","map":{"version":3,"names":["_extends","clsx","extractEventHandlers","omitEventHandlers","mergeSlotProps","parameters","getSlotProps","additionalProps","externalSlotProps","externalForwardedProps","className","joinedClasses","mergedStyle","style","props","length","Object","keys","internalRef","undefined","eventHandlers","componentsPropsWithoutEventHandlers","otherPropsWithoutEventHandlers","internalSlotProps","ref"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@mui/base/utils/mergeSlotProps.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport clsx from 'clsx';\nimport extractEventHandlers from './extractEventHandlers';\nimport omitEventHandlers from './omitEventHandlers';\n\n/**\n * Merges the slot component internal props (usually coming from a hook)\n * with the externally provided ones.\n *\n * The merge order is (the latter overrides the former):\n * 1. The internal props (specified as a getter function to work with get*Props hook result)\n * 2. Additional props (specified internally on an unstyled component)\n * 3. External props specified on the owner component. These should only be used on a root slot.\n * 4. External props specified in the `componentsProps.*` prop.\n * 5. The `className` prop - combined from all the above.\n * @param parameters\n * @returns\n */\nexport default function mergeSlotProps(parameters) {\n  const {\n    getSlotProps,\n    additionalProps,\n    externalSlotProps,\n    externalForwardedProps,\n    className\n  } = parameters;\n\n  if (!getSlotProps) {\n    // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,\n    // so we can simply merge all the props without having to worry about extracting event handlers.\n    const joinedClasses = clsx(externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className, className, additionalProps == null ? void 0 : additionalProps.className);\n\n    const mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n\n    const props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);\n\n    if (joinedClasses.length > 0) {\n      props.className = joinedClasses;\n    }\n\n    if (Object.keys(mergedStyle).length > 0) {\n      props.style = mergedStyle;\n    }\n\n    return {\n      props,\n      internalRef: undefined\n    };\n  } // In this case, getSlotProps is responsible for calling the external event handlers.\n  // We don't need to include them in the merged props because of this.\n\n\n  const eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps));\n  const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);\n  const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);\n  const internalSlotProps = getSlotProps(eventHandlers); // The order of classes is important here.\n  // Emotion (that we use in libraries consuming MUI Base) depends on this order\n  // to properly override style. It requires the most important classes to be last\n  // (see https://github.com/mui/material-ui/pull/33205) for the related discussion.\n\n  const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);\n\n  const mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n\n  const props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);\n\n  if (joinedClasses.length > 0) {\n    props.className = joinedClasses;\n  }\n\n  if (Object.keys(mergedStyle).length > 0) {\n    props.style = mergedStyle;\n  }\n\n  return {\n    props,\n    internalRef: internalSlotProps.ref\n  };\n}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,iBAAiB,MAAM,qBAAqB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,cAAc,CAACC,UAAU,EAAE;EACjD,IACEC,YAAY,GAKVD,UAAU,CALZC,YAAY;IACZC,eAAe,GAIbF,UAAU,CAJZE,eAAe;IACfC,iBAAiB,GAGfH,UAAU,CAHZG,iBAAiB;IACjBC,sBAAsB,GAEpBJ,UAAU,CAFZI,sBAAsB;IACtBC,SAAS,GACPL,UAAU,CADZK,SAAS;EAGX,IAAI,CAACJ,YAAY,EAAE;IACjB;IACA;IACA,IAAMK,cAAa,GAAGV,IAAI,CAACQ,sBAAsB,IAAI,IAAI,GAAG,KAAK,CAAC,GAAGA,sBAAsB,CAACC,SAAS,EAAEF,iBAAiB,IAAI,IAAI,GAAG,KAAK,CAAC,GAAGA,iBAAiB,CAACE,SAAS,EAAEA,SAAS,EAAEH,eAAe,IAAI,IAAI,GAAG,KAAK,CAAC,GAAGA,eAAe,CAACG,SAAS,CAAC;IAEjP,IAAME,YAAW,GAAGZ,QAAQ,CAAC,CAAC,CAAC,EAAEO,eAAe,IAAI,IAAI,GAAG,KAAK,CAAC,GAAGA,eAAe,CAACM,KAAK,EAAEJ,sBAAsB,IAAI,IAAI,GAAG,KAAK,CAAC,GAAGA,sBAAsB,CAACI,KAAK,EAAEL,iBAAiB,IAAI,IAAI,GAAG,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